import diagramManager from "./components/DiagramManager/index";
import processDesign from "./components/DiagramManager/processDesign/index";
import variableManager from "./components/DiagramManager/variableManager/index";
import bpmnXml from "./components/DiagramManager/bpmnXml/index";
import bpmnViewer from "./components/DiagramManager/bpmnViewer/index";

import './assets/font_icon/iconfont.css'
import "bpmn-js/dist/assets/diagram-js.css";
import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
import VueHighlightJS from 'vue-highlightjs'
import 'highlight.js/styles/atom-one-dark.css'


const components = [
    bpmnXml,
    diagramManager,
    processDesign,
    variableManager,
    bpmnViewer
];
// 定义 install 方法，接收 Vue 作为参数。如果使用 use 注册插件，则所有的组件都将被注册
const install = function(Vue) {
    // 判断是否安装
    if (install.installed) return;
    install.installed = true
    // 遍历注册全局组件
    components.forEach(component => {
        Vue.component(component.name, component)
    });
    Vue.use(VueHighlightJS)
};
// 判断是否是直接引入文件
if (typeof window !== "undefined" && window.Vue) {
    install(window.Vue);
}

let BpmnDesign =  {
    install,// 导出的对象必须具有 install，才能被 Vue.use() 方法安装
    components // 以下是具体的组件列表
};
export default BpmnDesign;
